home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_aet_usedilator.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  168 lines

  1. # Jones 3D Cog Script
  2. #
  3. # aet_UseDilator.cog
  4. #
  5. # [TL]
  6. #
  7. # This cog is used to control the opening of, and saylines surrounding, the membrane doors
  8. # for the P.O.R.s.  
  9. #
  10. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12. symbols
  13.     
  14. message     startup
  15. message     damaged
  16. message        activated
  17. message        crossed
  18.  
  19. surface     mem                            mask=0x408    # No move adjoin.
  20.  
  21. thing        mem3do                                    # 3do membrane-no collide.    
  22. thing        target                                    # Camera target for camoffset.
  23. thing        look_target                                # Camera look target for camoffset.
  24. thing        player                        local
  25.  
  26. sound        fade=aet_por_open.wav        local
  27. sound        gizmo=AT03J01.WAV            local        # Line once he uses the Imp5 to open membrane.
  28. sound        barrier=AT03J02.WAV            local        # Line for when Indy first activates membrane.
  29. sound        better=AT03J03.WAV            local        # Line once he crosses into the POR.
  30.  
  31. int            done=0                        local        # Int to tell the cog when the membrane is open for good.
  32.  
  33. cog            aetDoorTalk                                # Aetherium doortalk cog for different lines.
  34.  
  35. end
  36.  
  37. # ========================================================================================
  38. code
  39.  
  40. startup:
  41.  
  42. player = GetLocalPlayerThing();
  43. global1 = 0;    
  44. global2 = 0;
  45. global3 = 0;
  46.  
  47. return;
  48.     
  49. # ........................................................................................
  50. activated:
  51.  
  52. # If Indy activates the membrane with nothing in hand.
  53. if ((GetSenderRef() == mem) && (GetSourceRef() == player) && (GetCurWeapon(player) == 0) || (GetCurWeapon(player) != 18))
  54.     {
  55.     if (global1 == 0)
  56.         {
  57.         global1 = 1;
  58.         # Begin small cutscene.
  59.         MakeMeStop();
  60.         DeselectWeaponWait(player);    
  61.         StartCutscene(0);
  62.         # Camera offset.
  63.         SetExtCamOffsetToThing(target);
  64.         //SetExtCamLookOffsetToThing(look_target);
  65.         PlayMode(player, 60, 0);
  66.         # "Well now!  From this side, the barrier between worlds..."
  67.         PlayVoice(player, barrier, 1.0, 1);
  68.         # Return to normal.
  69.         ResetThing(player);
  70.         ClearActorFlags(player, 0x200000);
  71.         RestoreExtCam();
  72.         EndCutScene();
  73.         return;
  74.         }
  75.     if (global1 != 0)
  76.         {
  77.         # Begin small cutscene.
  78.         if (MakeMeStop() == -1)
  79.             return;
  80.         DeselectWeaponWait(player);    
  81.         StartCutscene(0);
  82.         # Camera offset.
  83.         SetExtCamOffsetToThing(target);
  84.         //SetExtCamLookOffsetToThing(look_target);
  85.         PlayMode(player, 60, 0);
  86.         SendMessageEx(aetDoorTalk, user3, player, 0, 0, 0);
  87.         while (global15 == 0)
  88.             {
  89.             #Wait for line to finish...
  90.             Sleep(0.01);
  91.             }
  92.         # Return to normal.
  93.         ResetThing(player);
  94.         ClearActorFlags(player, 0x200000);
  95.         RestoreExtCam();
  96.         EndCutScene();
  97.         }
  98.     }
  99.  
  100. return;
  101.  
  102. # ........................................................................................
  103. damaged:
  104.  
  105. # Code for when Imp5 is used on no move adjoin.
  106. if ((GetParam(1) == 0x5000) && (done == 0))
  107. {
  108.     done = 1;
  109.     # Begin small cutscene.
  110.     MakeMeStop();
  111.     StartCutscene(0);
  112.     //DeselectWeaponWait(player);    
  113.     SetExtCamOffsetToThing(target);
  114.     //SetExtCamLookOffsetToThing(look_target);
  115.     # Fade out mem 3do.
  116.     ThingFadeAnim(mem3do, 1, 0, 3.0, 0);
  117.     PlaySoundLocal(fade, 1.0, 0, 0x0000, 0);
  118.     Sleep(3.1);
  119.     # Check to see if this line already played.
  120.     if (global2 == 0)
  121.         {
  122.         # "Well Now!  This gizmo seems to open..."
  123.         PlayVoice(player, gizmo, 1.0, 1);
  124.         global3 = 1;
  125.         }
  126.     if (global2 == 1)
  127.         {
  128.         # Code for using aet_DoorTalk.cog.
  129.         SendMessageEx(aetDoorTalk, user1, player, 0, 0, 0);
  130.         while (global15 == 0)
  131.             {
  132.             #Wait for line to finish...
  133.             Sleep(0.01);
  134.             }
  135.         }
  136.     global2 = 1;
  137.     # Destroy no longer needed membrane 3do.
  138.     DestroyThing(mem3do);
  139.     # Set no move adjoin to "move".
  140.     SetAdjoinFlags(mem, 2);
  141.     # Return to normal.
  142.     ClearActorFlags(player, 0x200000);
  143.     RestoreExtCam();
  144.     EndCutScene();
  145. }
  146.  
  147. return;
  148.  
  149. # ........................................................................................
  150. crossed:
  151.  
  152. # Code for entering a P.O.R. for the first time and playing the right line.
  153. if (GetSenderRef() == mem)
  154.     {
  155.     if (global3 == 1)
  156.         {
  157.         global3 = 2;
  158.         # "...and I feel better already!"
  159.         PlayVoice(player, better, 1.0, 0);
  160.         }
  161.     }
  162.  
  163. return;
  164.  
  165. # ........................................................................................
  166. end
  167.  
  168.